import os,sys

def flist():
    print os.listdir(os.getcwd())

def frename(src,dst):
    os.rename(src,dst)

def fcopy(src,dst):
    os.system("cp -r %s %s" % (src, dst))
    
def fremove(arg):
    os.system("rm -r %s" % (arg))    

def get_data_list(site_name,file_name):
    data=[]
    f = open(site_name+'/'+file_name,'r')
    f.close
    l=f.readline()
    while not(l==''):
        l=l[:-1]        
        ll=l.split(',')
        # change type of data from string to float
        j=[]
        for i in ll:
            j.append(int(i))
        data.append(j)
        l=f.readline()
    return data
    
def save_data_list(data,site_name,file_name):
    f = open (site_name+'/'+file_name, 'w')
    for i in data:       
        f.writelines(str(i)[1:-1]+'\n')
    f.close
